#!/usr/bin/env python
# -*- coding: utf-8 -*-

import wx
import time

from clockwindow import ClockWindow

class TPStaticText(wx.StaticText):  
    """ transparent StaticText """ 
    def __init__(self,parent,id,label='',  
                 pos=wx.DefaultPosition,  
                 size=wx.DefaultSize,  
                 style=0,  
                 name = 'TPStaticText'):  
        style |= wx.CLIP_CHILDREN | wx.TRANSPARENT_WINDOW   
        wx.StaticText.__init__(self,parent,id,label,pos,size,style = style)  
        self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)  
        self.Bind(wx.EVT_PAINT,self.OnPaint)  
          
    def OnPaint(self,event):  
        event.Skip()  
        dc = wx.GCDC(wx.PaintDC(self) )  
        dc.SetFont(self.GetFont())                  
        dc.DrawText(self.GetLabel(), 0, 0)
        
class timecontrol(wx.Window):
    def __init__(self, parent):
        wx.Window.__init__(self, parent, style=wx.TRANSPARENT_WINDOW)
        times = time.strftime('%Y-%m-%d   %H:%M:%S', time.localtime(time.time()))
        recordtype = TPStaticText(self, -1, _('Current Record'))
#        self.currenttime = wx.StaticText(self, -1, times)
#	self.recordtype = wx.StaticText(self, -1, _('Current Record'), style=wx.ALIGN_CENTRE | wx.TRANSPARENT_WINDOW)
#         self.clock = ClockWindow(self)
#	self.recordtype.SetTransparent(0)
#         self.recordtype.SetBackgroundColour(wx.Colour(0, 0, 0, 0))
#         sizer = wx.FlexGridSizer(3, 1)
#         sizer.Add(self.recordtype, 0, 0)
#         sizer.Add(self.clock, 1, 0)
#         sizer.Add(self.currenttime, 2, 0)
#         self.SetSizer(sizer)

        self.SetTransparent(0)
